\section{IIRFilter Class Reference}
\label{class_i_i_r_filter}\index{IIRFilter@{IIRFilter}}


{\ttfamily \#include $<$IIRFilter.h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\bf IIRFilter} (vector$<$ double $>$ num, vector$<$ double $>$ den)
\item 
{\bf $\sim$IIRFilter} ()
\item 
double {\bf tickFilter} (double val)
\end{DoxyCompactItemize}
\subsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static void {\bf ButterworthFilter} (int order, double w\_\-c, double w\_\-s, {\bf FilterType} type, double $\ast$num, double $\ast$den)
\item 
static void {\bf shelvingFilter} (vector$<$ double $>$ \&b, vector$<$ double $>$ \&a, double tone, double w\_\-c, double w\_\-s)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
\begin{Desc}
\item[{\bf Todo}]Fix the representation of polynomial coefficients across functions to be consistent (either all double$\ast$'s or all vectors) \end{Desc}


\subsection{Constructor \& Destructor Documentation}
\index{IIRFilter@{IIRFilter}!IIRFilter@{IIRFilter}}
\index{IIRFilter@{IIRFilter}!IIRFilter@{IIRFilter}}
\subsubsection[{IIRFilter}]{\setlength{\rightskip}{0pt plus 5cm}IIRFilter::IIRFilter (
\begin{DoxyParamCaption}
\item[{vector$<$ double $>$}]{num, }
\item[{vector$<$ double $>$}]{den}
\end{DoxyParamCaption}
)}\label{class_i_i_r_filter_ac88119f8cca52fb7055d172b780ea729}
Constructor for the IIR Filter class. 
\begin{DoxyParams}{Parameters}
{\em num} & A vector of doubles containing the coefficients of the polynomial numerator of the z-\/domain transfer function of the IIR filter.\\
\hline
{\em den} & A vector of doubles containing the coefficients of the polynomial denominator of the z-\/domain transfer function of the IIR filter. \\
\hline
\end{DoxyParams}
\index{IIRFilter@{IIRFilter}!$\sim$IIRFilter@{$\sim$IIRFilter}}
\index{$\sim$IIRFilter@{$\sim$IIRFilter}!IIRFilter@{IIRFilter}}
\subsubsection[{$\sim$IIRFilter}]{\setlength{\rightskip}{0pt plus 5cm}IIRFilter::$\sim$IIRFilter (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}\label{class_i_i_r_filter_a7fbc93f9fc0ff65e785f8f2bfe13cfdf}
Destructor for the IIR filter 

\subsection{Member Function Documentation}
\index{IIRFilter@{IIRFilter}!ButterworthFilter@{ButterworthFilter}}
\index{ButterworthFilter@{ButterworthFilter}!IIRFilter@{IIRFilter}}
\subsubsection[{ButterworthFilter}]{\setlength{\rightskip}{0pt plus 5cm}static void IIRFilter::ButterworthFilter (
\begin{DoxyParamCaption}
\item[{int}]{order, }
\item[{double}]{w\_\-c, }
\item[{double}]{w\_\-s, }
\item[{{\bf FilterType}}]{type, }
\item[{double $\ast$}]{num, }
\item[{double $\ast$}]{den}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  [static]}}\label{class_i_i_r_filter_a7cc7a385cc2ce74a7429e272ecee97b7}
Computes the coefficients of the numerator and denominator polynomials for the discrete-\/time (z-\/domain) transfer function for a Butterworth filter of arbitrary order.


\begin{DoxyParams}{Parameters}
{\em order} & The number of poles to be used in the filter (the greater the number of poles, the sharper the filter response).\\
\hline
{\em w\_\-c} & The cutoff frequency of the Butterworth filter\\
\hline
{\em w\_\-s} & The sampling frequency of the signal being filtered by the Butterworth filter\\
\hline
{\em type} & A value specifying the type of filter to be implemented\\
\hline
{\em num} & An array of doubles that will contain the coefficients of the polynomial numerator of the transfer function after this function finshes executing. Space for this array must be allocated before this function is called.\\
\hline
{\em den} & An array of doubles the will contain the coefficients of the polynomial denominator of the transfer function after this function finishes executing. Space for this array must be allocated before this function is called.\\
\hline
\end{DoxyParams}
\begin{Desc}
\item[{\bf Todo}]Add funcationality for Bandpass and Bandstop modes \end{Desc}
\index{IIRFilter@{IIRFilter}!shelvingFilter@{shelvingFilter}}
\index{shelvingFilter@{shelvingFilter}!IIRFilter@{IIRFilter}}
\subsubsection[{shelvingFilter}]{\setlength{\rightskip}{0pt plus 5cm}static void IIRFilter::shelvingFilter (
\begin{DoxyParamCaption}
\item[{vector$<$ double $>$ \&}]{b, }
\item[{vector$<$ double $>$ \&}]{a, }
\item[{double}]{tone, }
\item[{double}]{w\_\-c, }
\item[{double}]{w\_\-s}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  [static]}}\label{class_i_i_r_filter_a9bbe0780b8b3cd4053cb0115043329f3}
Computes the coefficients of the numerator and denominator polynomials for the discrete-\/time (z-\/domain) transfer function for a first order shelving filter.


\begin{DoxyParams}{Parameters}
{\em b} & Vector of doubles representing the coefficients of the numerator polynomial for the discrete-\/time (z-\/domain) transfer function\\
\hline
{\em a} & Vector of doubles representing the coefficients of the denominator polynomial for the discrete-\/time (z-\/domain) transfer function\\
\hline
{\em tone} & A double between 0 and 100 that changes the output tone of the shelving filter (0 corresponds to a more muddy, bassy sound whereas 100 corresponds to a more trebly sound).\\
\hline
{\em w\_\-c} & The cutoff frequency of the shelving filter\\
\hline
{\em w\_\-s} & The sampling frequency of the shelving filter\\
\hline
\end{DoxyParams}
\begin{Desc}
\item[{\bf Todo}]Add support for higher order shelving filters \end{Desc}
\index{IIRFilter@{IIRFilter}!tickFilter@{tickFilter}}
\index{tickFilter@{tickFilter}!IIRFilter@{IIRFilter}}
\subsubsection[{tickFilter}]{\setlength{\rightskip}{0pt plus 5cm}double IIRFilter::tickFilter (
\begin{DoxyParamCaption}
\item[{double}]{val}
\end{DoxyParamCaption}
)}\label{class_i_i_r_filter_acb7183bf7a47c191d9fcde307fde6d6f}
Computes filtered value of the given data point based on the values of the filter's transfer function as well as a time history maintained internally by the filter. This means that tickFilter must be called on the samples in temporal order.


\begin{DoxyParams}{Parameters}
{\em val} & The next value in the signal to be filtered\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The filtered value corresponding to the unfiltered parameter passed into the function 
\end{DoxyReturn}


The documentation for this class was generated from the following file:\begin{DoxyCompactItemize}
\item 
Include/{\bf IIRFilter.h}\end{DoxyCompactItemize}
